package com.skivingcloud.common.utils;

import java.io.Serializable;

/**
 * 分页查询时的参数
 * @author hushouquan
 */
public class PageParameter<T> implements Serializable{
    /**
     * 第几页
     */
    private Integer page = 1;
    
    /**
     * 每页几条
     */
    private Integer pageSize = 10;
    /**
     * 查询参数
     */
    private T param;
    
    public Integer getPage(){
        return page;
    }
    
    public void setPage(Integer page){
        this.page = page;
    }
    
    public Integer getPageSize(){
        return pageSize;
    }
    
    public void setPageSize(Integer pageSize){
        this.pageSize = Math.min(pageSize, 200);
    }
    
    public T getParam(){
        return param;
    }
    
    public void setParam(T param){
        this.param = param;
    }
    
    @Override
    public String toString(){
        return "PageParameter{" + "page=" + page +
                ", pageSize=" + pageSize +
                ", param=" + param +
                '}';
    }
}
